﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>电商后台系统</title>
    <link href="~/css/login.css" rel="stylesheet" />
    <script type="text/javascript" src="~/js/jquery.min.js"></script>
    <script type="text/javascript" src="~/js/index.js"></script>
    <script src="~/lib/layui/layui.js"></script>
</head>
<body class="login-bg">
    <canvas id="fullstarbg">你的浏览器不支持canvas标签</canvas>
    <div class="login">
        <div class="message">电商后台系统</div>
        <div id="darkbannerwrap"></div>
        <form method="post" class="layui-form" id="Fm">
            @*设置一个id值，用于ajsx提交*@
            <input name="username" placeholder="用户名" type="text" class="layui-input">
            <hr class="hr15">
            <input name="password" placeholder="密码" type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" style="width:100%;" type="button" onclick="Tj()">@*设置一个点击事件*@
            <hr class="hr20">
        </form>
    </div>
    <script>
            layui.use(['form'],
                function () {
                    $ = layui.jquery;
                    var form = layui.form,
                        layer = layui.layer;

                    //监听提交
                    form.on('submit(login)',
                        function (data) {
                            window.location.href = "index.html";
                            return false;
                        }
                    );
                });
            function Tj() {
                var p = $("#Fm").serialize();
                $.post("/Home/Login", p, function (res) {
                    if (res.success)
                        window.location.href = "/Home";
                    else
                        layer.msg(res.message, { time: 2000, icon: 6 });
                }, "Json");
            }

        </script>
    

    <!-- 底部结束 -->

</body>
</html>
